<template>
  <div id="chA">
     <h3>{{msg}}</h3>
     <input v-model="hAMsg" type="text"/> <button @click="sendMsg">传值给children组件</button>
  </div>
</template>
<script>
  import store from '../../vuex/store'

  export default{
      store,
      data(){
          return {
              msg:"我是children的子组件childrenA",
              hAMsg:""
          }
      },
      methods:{
        sendMsg(){
           //调用mutations里面的方法改变state中的数据
           this.$store.commit("setMsg",this.hAMsg);
        }
      }
  }
</script>
<style lang="scss">
   #chA{
       width: 50%;
       height: 200px;
       outline: solid 0.5px grey;
   }
</style>
